#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char arr[30];
	char a, b;
	cin >> arr;
	getchar();
	cin >> a >> b;
	for (int i = 0; i < strlen(arr); i++) {
		if (arr[i] == a) {
			arr[i] = b;
		}
	}
	for (int i = 0; i < strlen(arr); i++) {
		cout << arr[i];
	}
	return 0;
}
